<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<title>信息管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" th:src="@{/scripts/jquery/jquery-1.7.1.js}"></script>
<link th:href="@{/style/authority/basic_layout.css}" rel="stylesheet" type="text/css">
<link th:href="@{/style/authority/common_style.css}" rel="stylesheet" type="text/css">
<script type="text/javascript" th:src="@{/scripts/authority/commonAll.js}"></script>
<script type="text/javascript" th:src="@{/scripts/jquery/jquery-1.4.4.min.js}"></script>
<script th:src="@{/scripts/My97DatePicker/WdatePicker.js}" type="text/javascript" defer="defer"></script>
<script type="text/javascript" th:src="@{/scripts/artDialog/artDialog.js?skin=default}"></script>
<script type="text/javascript">
	//js获取项目根路径，如： http://localhost:8083/uimcardprj
	function getRootPath(){
		//获取当前网址，如： http://localhost:8083/uimcardprj/share/meun.jsp
		var curWwwPath=window.document.location.href;
		//获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
		var pathName=window.document.location.pathname;
		var pos=curWwwPath.indexOf(pathName);
		//获取主机地址，如： http://localhost:8083
		var localhostPaht=curWwwPath.substring(0,pos);
		//获取带"/"的项目名，如：/uimcardprj
		var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
		return(localhostPaht+projectName);
	}

	$(document).ready(function() {
		/*
		 * 提交
		 */
		$("#submitbutton").click(function() {
			if(validateForm()){
				checkFyFhSubmit();
			}
		});
		
		/*
		 * 取消
		 */
		$("#cancelbutton").click(function() {
			/**  关闭弹出iframe  **/
			window.parent.$.fancybox.close();
		});
		
		var result = 'null';
		if(result =='success'){
			/**  关闭弹出iframe  **/
			window.parent.$.fancybox.close();
		}
	});
	
	function checkFyFhSubmit(){
		let name = $('#name').val();
		let address = $("#address").val();
		let phone = $("#phone").val();
		let id = $("#id").val();
		$.ajax({
			type:"POST",
			url: getRootPath() + "/resume/",
			data:{"id":id,"name":name,"address":address, "phone":phone},
			dataType : "json",
			contentType:'application/x-www-form-urlencoded; charset=UTF-8',
			success:function(data){
				if (data=="1"){
					art.dialog({icon:'success', title:'操作成功', drag:false, resize:false, content:'操作成功', ok:true,});
				}
				window.parent.$.fancybox.close();
			}
		});
		return true;
	}
	
	/** 表单验证  **/
	function validateForm(){
		if($("#name").val()==""){
			art.dialog({icon:'error', title:'友情提示', drag:false, resize:false, content:'填写姓名', ok:true,});
			return false;
		}
		if($("#address").val()==""){
			art.dialog({icon:'error', title:'友情提示', drag:false, resize:false, content:'填写地址', ok:true,});
			return false;
		}
		if($("#phone").val()==""){
			art.dialog({icon:'error', title:'友情提示', drag:false, resize:false, content:'填写手机号码', ok:true,});
			return false;
		}
		return true;
	}
</script>
</head>
<body>
<form id="submitForm" name="submitForm" action="/resume/" method="post">
	<input type="hidden" name="id" th:value="${resume.id}" id="id"/>
	<div id="container">
		<div id="nav_links">
			当前位置：简历中心&nbsp;>&nbsp;<span style="color: #1A5CC6;">简历编辑</span>
			<div id="page_close">
				<a href="javascript:parent.$.fancybox.close();">
					<img th:src="@{/images/common/page_close.png}" width="20" height="20" style="vertical-align: text-top;"/>
				</a>
			</div>
		</div>
		<div class="ui_content">
			<table  cellspacing="0" cellpadding="0" width="100%" align="left" border="0">
				<tr>
					<td class="ui_text_rt">名字</td>
					<td class="ui_text_lt">
						<input type="text" id="name" name="name" th:value="${resume.name}" class="ui_input_txt02"/>
					</td>
				</tr>
				<tr>
					<td class="ui_text_rt">地址</td>
					<td class="ui_text_lt">
						<input type="text" id="address" name="address" th:value="${resume.address}" class="ui_input_txt02"/>
					</td>
				</tr>
				<tr>
					<td class="ui_text_rt">手机号码</td>
					<td class="ui_text_lt">
						<input type="text" id="phone" name="phone"  th:value="${resume.phone}" class="ui_input_txt02"/>
					</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
					<td class="ui_text_lt">
						&nbsp;<input id="submitbutton" type="button" value="提交" class="ui_input_btn01"/>
						&nbsp;<input id="cancelbutton" type="button" value="取消" class="ui_input_btn01"/>
					</td>
				</tr>
			</table>
		</div>
	</div>
</form>
<div style="display:none"><script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script></div>
</body>
</html>